<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$is_language?'充值申請詳情':'Details of application for incorporation'}</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/weui.min.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/jquery-weui.css">
    <link rel="stylesheet" href="__MODULE_LIBS__/css/demos.css">
    <script src="__MODULE_LIBS__/js/jquery-2.1.4.js"></script>
    <script src="__MODULE_LIBS__/js/fastclick.js"></script>
    <script src="__MODULE_LIBS__/js/jquery-weui.js"></script>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        html {
            width: 100%;
            height: 100%;
            font-size: 20px;
            font-family: "Microsoft YaHei", "宋体", "Segoe UI", "Lucida Grande", Helvetica, Arial, sans-serif, FreeSans, Arimo;
            background: #F3F3F3;
        }

        body {
            margin: 0 auto;
            max-width: 750px;
            height: 100%;
            background: #F7F7F7;
        }

        /*顶部导航栏处的样式*/
        .navbar {
            position: relative;
            width: 100%;
            height: 2rem;
            font-size: 16px;
            color: #fff;
            line-height: 2rem;
            background: #373553;
        }

        .navbar-item {
            position: absolute;
            left: 0;
            top: 0;
            display: block;
            width: 3.2rem;
            height: 2rem;
            font-size: 14px;
            color: #fff;
            text-align: center;
        }

        .navbar-item > img {
            width: 0.8rem;
            height: 0.7rem;
            vertical-align: middle;
        }

        .navbar-center {
            text-align: center;
        }

        /*主体部分的样式*/
        .content {
            width: 100%;
        }

        .weui-cells {
            font-size: 0.8rem;
        }

        .weui-cell__hd {
            width: 5.2rem;
        }

        .weui-cell_link {
            font-size: 0.6rem;
            color: #999999;
        }

        .mix {
            color: #F44444;
        }

        .weui-select {
            padding-left: 0;
            height: 1.2rem;
            line-height: 1.2rem;
            -webkit-appearance: menulist;
        }

        .weui-btn-area {
            margin: 1rem 3.5rem 0.3rem;
        }

        .weui-btn {
            line-height: 2.2;
        }
    </style>
</head>
<body>
<header class="navbar">
    <a href="{:url('mix_apply_list')}" class="navbar-item">
        <img src="__MODULE_LIBS__/img/back.png"/>&nbsp;{$is_language?'返回':'Return'}
    </a>
    <div class="navbar-center">{$is_language?'充值申請詳情':'Details of application for incorporation'}</div>
    <div class="navbar-item1">
        <select name="" id="yy">
            <option value="1" {$is_language?
            'selected':''}>中文</option>
            <option value="0" {$is_language?
            '':'selected'}>English</option>
        </select>
    </div>
</header>
<div class="content">
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">{$is_language?'充值申請時間':'To the application
                time'}</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" value="{$data->create_time|date='Y-m-d H:i:s',###}"
                       readonly="readonly">
            </div>
        </div>
    </div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">{$is_language?'用戶賬號':'User account'}</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" value="{$data->username}" readonly="readonly">
            </div>
        </div>
    </div>
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">{$is_language?'充值美金':'Into the dollar'}</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" value="$<?php echo number_format($data->mix_money,2,'.',',');?>" readonly="readonly">
            </div>
        </div>


        <div class="weui-cell weui-cell_link">
            <div class="weui-cell__bd">
                <span> {$is_language?'美金匯率1美元':'US $1'}={$data->exchange}{$is_language?'人民幣':'RMB'}</span>
                <span class="{if $data->is_balance!=1}mix{/if}">{$is_language?'充值人民幣￥':'Exchange RMB ￥'}<?php echo number_format($data->money,2,'.',',');?></span>
            </div>
        </div>

        {if $data->is_balance==1}
        <div class="weui-cell weui-cell_link">
            <div class="weui-cell__bd">
                <span> {$is_language?'用戶為':'The user is '}{$data->balance_name},{$is_language?'充值折扣為:':'The import rate is:'}{$data->balance_rate},<span class="mix">{$is_language?'實際收款為￥:':'Exchange RMB is ￥'}{$data->balance_money}</span></span>
            </div>
        </div>
        {/if}
    </div>
    <form action="" method="post" class="mixForm">
        <input type="hidden" name="status" value="" class="status">
        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label"> {$is_language?'充值賬號':'Add in account'}</label>
                </div>
                <div class="weui-cell__bd">
                    <select class="weui-select" name="select" style="color: #777;">
                        <option value="">{$is_language?'請選擇充值賬號':'Please choose your account number'}</option>
                        {foreach $user_list as $v}
                        <option {if $data->mix_id==$v['id']}selected{/if} value="{$v['id']}">{$v['username']}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
        </div>
        <input type="hidden" name="id" value="{$data->id}">
        {if $data->status==0}
        <div class="weui-btn-area">
            <input class="weui-btn weui-btn_warn" id="adopt" type="button"
                   value="{$is_language?'確認審核':'Confirmation audit'}" name="status1">
        </div>
        <div class="weui-btn-area">
            <input class="weui-btn" type="button" id="refuse" value=" {$is_language?'審核拒絕':'Audit reject'}"
                   style="background: #999999;" name="status2">
        </div>
        {/if}
        {if $data->status==1}
        <div class="weui-btn-area">
            <input class="weui-btn weui-btn_warn" id="adopt2" type="button"
                   value="{$is_language?'確認收款':'Confirm receipt'}" name="status1">
        </div>
        <div class="weui-btn-area">
            <input class="weui-btn" type="button" id="refuse1" value=" {$is_language?'取消交易':'Cancel the transaction'}"
                   style="background: #999999;" name="status2">
        </div>
        {/if}
    </form>
</div>


<script type="text/javascript">
    $(document).on("change", 'select#yy', function () {
        var yy = $(this).val();
        console.log(yy)
        var url = "{:url('index/language')}";
        $.post(url, {language: yy}, function (res) {
            window.location.reload();
        })
    });
    $(function () {
        FastClick.attach(document.body);
        $("#adopt").click(function () {
            $(".status").val("1");
            $(".mixForm").submit();
        });

        $("#adopt2").click(function () {
            $(".status").val("2");
            $(".mixForm").submit();
        });

        $("#refuse").click(function () {
            $(".status").val("3");
            $(".mixForm").submit();
        });
        $("#refuse1").click(function () {
            $(".status").val("3");
            $(".mixForm").submit();
        });
    })
</script>
</body>
</html>
